#include "gx_err.h"
#include <stdio.h>
#include <stdlib.h>

void fatal(int code,char *s)
{
	fprintf(stderr,"errcode=%d,msg=%s\n",code,s);
	exit(code);
}

void print_err_msg(int code)
{
	switch(code)
	{
		case 0:
			printf("SUCCESS");
			break;
		case 1:
			printf("There is no more memory");
			break;
		case 2:
			printf("Parameter error");
			break;
		case 3:
			printf("NO DATA");
			break;
		case 4:
			printf("SYSTEM ERROR");
			break;
		case 5:
			printf("DATA ALREADY EXIT");
		default:
			printf("UNKNOW ERROR");
	}
}
